import { BasicFetchResult, SaaSBasicPageParams } from '/@/api/model/baseModel';

export interface SummeryItem {
  tenants: string;
  subscribedApps: string;
  databases: string;
  namespaces: string;
  deployments: string;
  apps: string;
  services: string;
  ecs: string;
  users: string;
  orgCounts: string;
}

export interface CceInfo {
  clusterId: string;
  endpoint: string;
  description: string;
}

export interface CseInfo {
  userName: string;
  password: string;
  passwordSalt: string;
  saltForSalt: string;
  registerAddress: string;
  configAddress: string;
  projectId: string;
}

export interface BasicDataItem {
  subscribedApps: string;
  databases: string;
  namespaces: string;
  deployments: string;
  apps: string;
  services: string;
  ecs: string;
}

export interface TenantItem {
  code: string;
  name: string;
}
export interface AppItem {
  id: string;
  name: string;
}

export interface RdsItem {
  dbIp: string;
  dbName: string;
  instanceId: string;
  instanceName: string;
}
export interface PackageItem {
  type: string;
  enterpriseSize: string;
  isExpand: string;
  dbMultiTenantMode: string;
  appMultiTenantMode: string;
  ifWithLicense: string;
  specification: string;
}
export interface BasicItem {
  appName: string;
  tenantName: string;
  region: string;
  architecture: string;
}

export interface ComponentItem {
  currentDeployment: string;
  componentName: string;
  namespace: string;
  appName: string;
  serviceName: string;
  cpuUsage: string;
  memoryUsage: string;
}

export interface SubScribedAppItem {
  id?: string;
  tenantName?: string;
  tenantCode: string;
  appId?: string;
  appName?: string;
  packageName?: string;
  effectiveTime?: string;
  expireTime?: string;
  status?: string;
}

export type SubScribedResultModel = BasicFetchResult<SubScribedAppItem>;

export interface RdsInfo {
  isUsed: string;
  dbIp: string;
  dbPort: string;
  dbDriver: string;
  dbUsername: string;
  dbPassword: string;
  type: string;
}

export interface AppDeploymentMono {
  serialVersionUID: string;
  region: string;
  projectId: string;
  appId: string;
  iamId: string;
  rdsId: string;
  imageRef: string;
  cloudLinkUrl: string;
  clusterkey: string;
  appUrl: string;
  securityGroupId: string;
  vpcId: string;
  cloudLinkDir: string;
  appDir: string;
}

export interface AppDeploymentOfResourceDetails {
  region: string;
  cceInformation: CceInfo;
  cseInformation: CseInfo;
}
export interface DetailAppItem {
  architecture: string;
  isExpand: string;
  appMultiTenantMode: string;
  dbMultiTenantMode: string;
  rdsInformation?: RdsInfo;
  appDeploymentMono?: AppDeploymentMono;
  appDeploymentOfResourceDetailsDto?: AppDeploymentOfResourceDetails;
}

export type PageParams = {
  tenantCode: string;
  appId: string;
};

export type SubScribedAppPageParams = {
  model: PageParams;
} & SaaSBasicPageParams;

export type DetailParams = {
  appId: string;
};
export type TenantDetailParams = {
  tenantCode: string;
};
